<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "{{%material}}".
 *
 * @property integer $id
 * @property integer $advertiser_id
 * @property string $name
 * @property string $ext
 * @property string $path
 * @property integer $size
 * @property integer $width
 * @property integer $height
 * @property integer $duration
 * @property integer $upload_by
 * @property string $upload_ip
 * @property integer $status
 * @property string $last_update
 */
class Material extends \app\models\BaseAR
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%material}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['advertiser_id', 'name', 'ext', 'path', 'size', 'width', 'height'], 'required'],
            [['advertiser_id', 'size', 'width', 'height', 'duration', 'upload_by', 'status'], 'integer'],
            [['last_update'], 'safe'],
            [['name'], 'string', 'max' => 256],
            [['ext'], 'string', 'max' => 20],
            [['path'], 'string', 'max' => 512],
            [['upload_ip'], 'string', 'max' => 15]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'advertiser_id' => 'Advertiser ID',
            'name' => 'Name',
            'ext' => 'Ext',
            'path' => 'Path',
            'size' => 'Size',
            'width' => 'Width',
            'height' => 'Height',
            'duration' => 'Duration',
            'upload_by' => 'Upload By',
            'upload_ip' => 'Upload Ip',
            'status' => 'Status',
            'last_update' => 'Last Update',
        ];
    }
}
